#include("/common/layout/bootstrap_form_layout.html")
#@layout()

#define title()
#(jxrb.message(actionName,"systemRoleMenu"))#(systemrole.role_name ??)
#end

#define head()
#include("/common/layout/ztree_check_layout.html",treeDataUrl=jxwebpath.item+"roleMenu/treeData/"+(systemrole.role_id ??),treeLoadOkFunction="setOldMenuid();")
<script>
 seajs.use(["jquery", "jx_msgbox","jx_check"], function($, msgbox){
 $("#b_submit").on("click", function ()
 {
   if (!jxCheck.check()) {
        return false;
      }
    $("#menu_id").val(getCheckedNodes()) ;
    msgbox.confirm({url:"#(controllerKey)addPost/"},
    function()
    {
      msgbox.close();
      if (msgbox.messageType != 2)
        clearForm();
      }, function()
      {
       if (msgbox.messageType != 2)
         returnInfo();
      });
  });
  function setOldMenuid()
  {
    $("#old_menu_id").val(getCheckedNodes()) ;
  }

  $("#b_return").on("click", function ()
  {
   returnInfo();
  });
  function returnInfo()
  {
  location.href = "#(controllerKey)";
  }

  function clearForm()
  {
   #if (action == 'added')
     $("#roleName").val("");
     $("#roleCode").val("");
     ztreeObjct.checkAllNodes(false) ;
  #end
   }
  window.setOldMenuid = setOldMenuid;
  });
  seajs.use("jx_pinyin", function(jxpy){
  jxpy({nameObject:"#roleName", codeObject:"#roleCode"});
  });
</script>
#end

#define bodyExt()
class="gray-bg"
#end

#define form()
#include("info.html")
#end

#define formAfter()
<center>
    #jx_button({value:"action.save",class:"btn btn-primary"})&nbsp;&nbsp;&nbsp;&nbsp;
    #jx_button({value:"action.return",id:"b_return",class:"btn btn-danger"})
</center>
#end
